package com.coordinate.servlets;

import com.google.appengine.api.datastore.Blob;
import com.google.appengine.api.datastore.KeyFactory;
import com.google.appengine.api.datastore.Key;

import javax.jdo.annotations.*;

@PersistenceCapable(identityType = IdentityType.DATASTORE, detachable ="true")
public class VoiceMessage 
{
    @PrimaryKey
    @Persistent (valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key mKey;
    
    @Persistent 
    private String mFileName;
    
    @Persistent(defaultFetchGroup="true")
    private Blob        mVmFile;
    
    @Persistent
    private String mContentType;
    
    public VoiceMessage()
    {
       	this.mVmFile = null;
       	this.mKey = null;
    }
    
    public VoiceMessage(Blob pBlob,String pFileName)
    {
       	this.mVmFile = pBlob;
       	this.setFileName(pFileName);
    }
    
       
	public String getFileName() {
		return mFileName;
	}

	public void setFileName(String pFileName) {
		this.mFileName = pFileName;
	}

	public String getContentType() {
		return mContentType;
	}

	public void setContentType(String pContentType) {
		this.mContentType = pContentType;
	}

	public Blob getVmFile() {
		return mVmFile;
	}

	public void
    setVm(Blob pVmFile)
    {
    	this.mVmFile = pVmFile;
    }
	public Blob
    getVm()
    {
    	return this.mVmFile;
    }
    
    public String  getKey()
    {
       return KeyFactory.keyToString(mKey);	
    }
   
    
}
